<template>
  <m-list-box>
    <div slot="text">任务</div>
    <div slot="content">
      <el-select
        class="dis-b"
        size="small"
        v-model="griffinTaskId"
        :disabled="isDetails">
        <el-option
          v-for="item in jobs"
          :key="item.id"
          :value="item.id"
          :label="item['job.name']">
        </el-option>
      </el-select>
    </div>
  </m-list-box>
</template>
<script>
import * as _ from 'lodash';
import disabledState from '@/mixins/disabledState';
import mListBox from './_source/listBox';
import { griffinService } from '@/api/griffin';
export default {
  components: {
    mListBox
  },
  name: 'griffin',
  props: {
    backfillItem: Object
  },
  mixins: [disabledState],
  created(){
    let o = this.backfillItem;
    if(!_.isEmpty(o)){
      this.griffinTaskId = o.params.griffinTaskId || null;
    }
    griffinService.getJobs().then(
      res => {
        this.jobs = res.data || [];
        console.log(this.measures);
      }
    )
  },
  mounted(){
    console.log(this.backfillItem);
  },
  data(){
    return {
      localParams: [],
      griffinTaskId: null,
      jobs: []
    }
  },
  methods: {
    _verification(){
      this.$emit('on-params', {
        localParams: this.localParams,
        griffinTaskId: this.griffinTaskId
      })
      return true;
    },
    _onLocalParams (a) {
      this.localParams = a
    },
  }
}
</script>